public class Test1 {
    public static void main(String[] args) throws InterruptedException {
        Object object=new Object();
        synchronized (object){
            System.out.println("wait之前");
            //把wait要放到synchronized里面来调用，保证确实是拿到了锁
            object.wait();
            System.out.println("wait之后");
        }

    }
}
